<%- include ../public/page_head.html %>
<div class="container-fluid">
            <div class="panel panel-default">
			    <div class="panel-heading">
                 角色授权
                </div>
                <div class="panel-body">
                    <form action="/admin/role/doAuth" method="POST">
                        <input type="hidden" name="_csrf" value="<%=csrf%>" />
                        <input type="hidden" name="role_id"  value="<%=_id%>" />
                        <table class="table table-bordered">
                            <% for(var i=0;i<list.length;i++){%>
                                    <tr>
                                        <td align="right" style="background: #D8E2FA; padding-right: 10px; width: 150px;">
                                            <label>
                                                <input type="checkbox" class="module_cbo" <%if(list[i].checked){%> checked  <%}%> value="<%=list[i]._id%>" name="access_node" />
                                                <%=list[i].module_name%>&nbsp;&nbsp;
                                            </label>
                                        </td>
                                        <% for(var j=0;j<list[i].items.length;j++){%>
                                        <td>
                                                    <label>
                                                        <input  <%if(list[i].items[j].checked){%> checked  <%}%> type="checkbox" value="<%=list[i].items[j]._id%>" class="action_cbo"  name="access_node">&nbsp;
                                                        <%=list[i].items[j].action_name%>
                                                    </label>&nbsp;&nbsp;
                                        </td>
                                        <%}%>
                                    </tr>
                            <%}%>
                        </table>
                        <button type="submit" class="btn btn-primary">提交</button>
                        <button type="button" class="btn btn-default"><a style="color:black" href="/admin/role">返回</a></button>
                    </form>
                </div>
            </div>
        </div>
</body>
</html>
